home *** CD-ROM | disk | FTP | other *** search
- "======================================================================
- |
- | ArrayedCollection Method Definitions
- |
- ======================================================================"
-
-
- "======================================================================
- |
- | Copyright (C) 1990, 1991, 1992 Free Software Foundation, Inc.
- | Written by Steve Byrne.
- |
- | This file is part of GNU Smalltalk.
- |
- | GNU Smalltalk is free software; you can redistribute it and/or modify it
- | under the terms of the GNU General Public License as published by the Free
- | Software Foundation; either version 1, or (at your option) any later version.
- |
- | GNU Smalltalk is distributed in the hope that it will be useful, but WITHOUT
- | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- | FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- | details.
- |
- | You should have received a copy of the GNU General Public License along with
- | GNU Smalltalk; see the file COPYING. If not, write to the Free Software
- | Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- |
- ======================================================================"
-
-
- "
- | Change Log
- | ============================================================================
- | Author Date Change
- | sbb 16 Mar 91 Class creation now separate statement.
- |
- | sbb 29 Dec 90 Removed = and hash (put them into
- | SequenceableCollection).
- |
- | sbb 21 Sep 90 Removed storeOn: method; doesn't seem to be the right
- | thing.
- |
- | sbyrne 25 Apr 89 created.
- |
- "
-
- SequenceableCollection variableSubclass: #ArrayedCollection
- instanceVariableNames: ''
- classVariableNames: ''
- poolDictionaries: ''
- category: nil
- !
-
- ArrayedCollection comment:
- 'My instances are objects that are generally fixed size, and are accessed
- by an integer index. The ordering of my instance''s elements is determined
- externally; I will not rearrange the order of the elements.' !
-
- !ArrayedCollection class methodsFor: 'instance creation'!
-
- with: element1
- | anArrayedCollection |
- anArrayedCollection _ self new: 1.
- anArrayedCollection at: 1 put: element1.
- ^anArrayedCollection
- !
-
- with: element1 with: element2
- | anArrayedCollection |
- anArrayedCollection _ self new: 2.
- anArrayedCollection at: 1 put: element1.
- anArrayedCollection at: 2 put: element2.
- ^anArrayedCollection
- !
-
- with: element1 with: element2 with: element3
- | anArrayedCollection |
- anArrayedCollection _ self new: 3.
- anArrayedCollection at: 1 put: element1.
- anArrayedCollection at: 2 put: element2.
- anArrayedCollection at: 3 put: element3.
- ^anArrayedCollection
- !
-
- with: element1 with: element2 with: element3 with: element4
- | anArrayedCollection |
- anArrayedCollection _ self new: 4.
- anArrayedCollection at: 1 put: element1.
- anArrayedCollection at: 2 put: element2.
- anArrayedCollection at: 3 put: element3.
- anArrayedCollection at: 4 put: element4.
- ^anArrayedCollection
- !!
-
-
-
- !ArrayedCollection methodsFor: 'basic'!
-
- add: value
- self shouldNotImplement
- !!
-